﻿using System;
using UnityEngine;
using UnityEngine.U2D;

namespace Framework
{
    public interface ILoader
    {
        public GameObject LoadGameObject(string path, bool instantiate = false);

        public void LoadGameObjectAsync(string path, Action<GameObject> onComplete, bool instantiate);

        public Sprite LoadSprite(string path);

        public Texture LoadTexture(string path);
        
        /////////////////////////////////////SpriteAtlas////////////////////////////////////

        public void LoadSpriteAtlas(string path, Action<SpriteAtlas> onComplete);

        public Sprite GetAtlasSprite(string assetName);


        public void UnloadAsset(string path, bool unloadDependencies = false);

        public void UnloadAllAsset();

        //====================加载文本和二进制=====================================
        public string LoadText(string path);
    }
}